<style> .colorBtn01{ padding:2px;} </style>
<script>
var _lotto_id = {lotto_id};

$(function(){
  $("div#errormsg").text("赔率更新中...请稍等...");
  $("div#mainPageData").hide();
  
  $().getR3Pdata(_lotto_id,_gametype);
  
  // 切换赔率
  $("select#slcDisk").change(function(){
    $("input#disk").attr("value",$("select#slcDisk option:selected").val());
    $().getR3Pdata(_lotto_id,_gametype);
  });
  
  // 0-9 号码选择
  $("span#slcNumBtnGroup input:button").click(function(){
    var timebtnType = $("input:hidden#timebtnType").val();
    $("tbody#tbdr21 input:"+timebtnType).val("").css('background-color', '');
    $("tbody#tbdr21 input:"+timebtnType).getNum3($(this).index()).val("*").css('background-color', '#ffff8c');
    if(timebtnType=="checkbox"){
		$("tbody#tbdr21 input:checkbox[name^='r']:checked").parent().removeClass("k1");
	  	$("tbody#tbdr21 input:checkbox[name^='r'][value='*']").parent().addClass("k1");
    	$("tbody#tbdr21 input:checkbox[name^='r']:checked").removeAttr("checked");
    	$("tbody#tbdr21 input:checkbox[name^='r'][value='*']").attr("checked","checked");
    }
  });
  // 对对 号码选择
  $("input#slcPair2Num").click(function(){
    var timebtnType = $("input:hidden#timebtnType").val();
    $("tbody#tbdr21 input:"+timebtnType).val("").css('background-color', '');
    $("tbody#tbdr21 input:"+timebtnType).getPairNum2().val("*").css('background-color', '#ffff8c');
    $("tbody#tbdr21 input:"+timebtnType).getPairNum3().val("").css('background-color', '');
    if(timebtnType=="checkbox"){
		$("tbody#tbdr21 input:checkbox[name^='r']:checked").parent().removeClass("k1");
	  	$("tbody#tbdr21 input:checkbox[name^='r'][value='*']").parent().addClass("k1");
    	$("tbody#tbdr21 input:checkbox[name^='r']:checked").removeAttr("checked");
    	$("tbody#tbdr21 input:checkbox[name^='r'][value='*']").attr("checked","checked");
    }
  });
  // 豹子 号码选择
  $("input#slcPair3Num").click(function(){
    var timebtnType = $("input:hidden#timebtnType").val();
    $("tbody#tbdr21 input:"+timebtnType).val("").css('background-color', '');
    $("tbody#tbdr21 input:"+timebtnType).getPairNum3().val("*").css('background-color', '#ffff8c');
    if(timebtnType=="checkbox"){
		$("tbody#tbdr21 input:checkbox[name^='r']:checked").parent().removeClass("k1");
	  	$("tbody#tbdr21 input:checkbox[name^='r'][value='*']").parent().addClass("k1");
    	$("tbody#tbdr21 input:checkbox[name^='r']:checked").removeAttr("checked");
    	$("tbody#tbdr21 input:checkbox[name^='r'][value='*']").attr("checked","checked");
    }
  });
  
  
  
  $("#rdoQuickPair").html(crt_rdoQuickPair());
  
  // 全选
  $("fieldset#fldQuickPair input:checkbox#chkCheckAll").click(function(){
    if($(this).attr("checked")){
      $("fieldset#fldQuickPair input:checkbox[id!=chkCheckAll]").attr("checked","checked").attr("disabled","true");
    }else{
      $("fieldset#fldQuickPair input:checkbox").removeAttr("checked").removeAttr("disabled");
    }
  });
  
  // 组三 / 组六 转直
  $("fieldset#fldQuickPair input").click(function(){
    var timebtnType = $("input:hidden#timebtnType").val();
    $("td#divBtnQuick01 span").removeClass("btnchoiced").addClass("btnchoice");
    var addStr = "";
    var getTypeVal = $("fieldset#fldQuickPair input:radio:checked").val();
    var addArr = new Array();
    var tempI = 0;
    var chkValArr = new Array();
    var ptype = $("#ptypeGroup input[name='ptype']:checked").val();
    var pnum = $("#pnumGroup input[name='pnum']:checked").val();
    var numArr0 = [[],[],[]];
    var numArr1 = [[],[],[]];
    for(var i = 0; i < 10; i++){
      for(j = 0; j < 10; j++){
        if(i == pnum && j == pnum){ continue; }
        if(i == pnum || j == pnum || i == j){
          numArr0[0].push("" + pnum + i + j);
          numArr0[1].push("" + i + pnum + j);
          numArr0[2].push("" + i + j + pnum);
        }else{
          numArr1[0].push("" + pnum + i + j);
          numArr1[1].push("" + i + pnum + j);
          numArr1[2].push("" + i + j + pnum);
        }
      }
    }
    chkValArr[0] = numArr0[ptype];
    chkValArr[1] = numArr1[ptype];
    
    var chkNumArr = new Array();
    var chkNumArr2 = new Array();
    var tempI = 0;
    var chkFlag =false; var chkFlag10=false;var chkFlag11=false;var chkFlag12=false;var chkFlag13=false;
    $("fieldset#fldQuickPair input:checkbox:checked").each(function(idx){
        tempI = $(this).val();
        switch(tempI){
          case "chkAll": addArr = chkValArr[getTypeVal];return false;break;
          case "10":chkFlag10=true;break;
          case "11":chkFlag11=true;break;
          case "12":chkFlag12=true;break;
          case "13":chkFlag13=true;break;
          default:
          chkNumArr.push(tempI);
          chkNumArr2.push(tempI + '' + tempI);
          break;
        }
    });
    if(chkNumArr.length > 0){
      chkFlag = true;
      var patt1 = new RegExp("["+chkNumArr.join(",")+"]");
      var patt2 = eval("new RegExp(/(" + chkNumArr2.join("|") +")/i)");
    }
      
    var chkArr = new Array();
    for(idx in chkValArr[getTypeVal]){
      addThreeNum = $().addThreeNum(chkValArr[getTypeVal][idx]);
      if(chkFlag && (getTypeVal == 0) && chkValArr[getTypeVal][idx].split("").sort().join("").match(patt2)){
        addArr.push(chkValArr[getTypeVal][idx]);
      }else if(chkFlag && (getTypeVal > 0) && chkValArr[getTypeVal][idx].match(patt1)){
        addArr.push(chkValArr[getTypeVal][idx]);
      }else if(chkFlag10 && (addThreeNum % 2 == 1)){
        addArr.push(chkValArr[getTypeVal][idx]);
      }else if(chkFlag11 && (addThreeNum % 2 == 0)){
        addArr.push(chkValArr[getTypeVal][idx]);
      }else if(chkFlag12 && (addThreeNum > 13)){
        addArr.push(chkValArr[getTypeVal][idx]);
      }else if(chkFlag13 && (addThreeNum < 14)){
        addArr.push(chkValArr[getTypeVal][idx]);
      }
    }
    var tempStr = "";
    $("tbody#tbdr21 input:"+timebtnType).val("").css('background-color', '');
    $("tbody#tbdr21 input:"+timebtnType).getPairByArr(addArr).val("*").css('background-color', '#ffff8c');
    if(timebtnType=="checkbox"){
		$("tbody#tbdr21 input:checkbox[name^='r']:checked").parent().removeClass("k1");
	  	$("tbody#tbdr21 input:checkbox[name^='r'][value='*']").parent().addClass("k1");
    	$("tbody#tbdr21 input:checkbox[name^='r']:checked").removeAttr("checked");
    	$("tbody#tbdr21 input:checkbox[name^='r'][value='*']").attr("checked","checked");
    }
  });
  
  $("input:reset").click(function(){
    $("input").css('background-color', '');  
	$(".k1").removeClass("k1");   
  });
});
// 组三、组六转值
function crt_rdoQuickPair(){
  var str = "";
  var i = 0;
  str += "<fieldset id='fldQuickPair' style='font-weight:bold;width:700px' class='bgClc_{gametype}'>";
  str += "<input type='radio' name='rdoQuickPair' id='rdoQuickPair01' checked='checked' value='0' /><label for='rdoQuickPair01' class='blueblod'>组三转直(对对)</label>&nbsp;";
  str += "<input type='radio' name='rdoQuickPair' id='rdoQuickPair02' value='1' /><label for='rdoQuickPair02' class='blueblod'>组六转直</label>&nbsp;";
  str += "<br />[<label><input type='checkbox' id='chkCheckAll' value='chkAll' />全选</label>&nbsp;";
  for(i = 0; i < 10; i++){
    str += "<label><input type='checkbox' name='chkQuickPairNum[]' value='" + i + "' />" + i + "</label>&nbsp;";
  }
  
  str += "<label><input type='checkbox' name='chkQuickPairNum[]' value='10' />合单</label>&nbsp;";
  str += "<label><input type='checkbox' name='chkQuickPairNum[]' value='11' />合双</label>&nbsp;";
  str += "<label><input type='checkbox' name='chkQuickPairNum[]' value='12' />合大</label>&nbsp;";
  str += "<label><input type='checkbox' name='chkQuickPairNum[]' value='13' />合小</label>&nbsp;";
  str += "&nbsp;]&nbsp;";
  str += "</fieldset>";
  return str;    
}

</script>
<div id="errormsg"></div>
<div id="mainPageData">

<form action="{action}" method="post" style="margin-top:0">
<input type="hidden" value="{timebtnType}" name="timebtnType" id="timebtnType" />
<input type="hidden" value="" name="disk" id="disk" />
<span class="td6" id="ptypeGroup">
定位别：
<input type="radio" value="0" name="ptype" id="ptype0" checked="checked" /><label for="ptype0">佰</label>
<input type="radio" value="1" name="ptype" id="ptype1" /><label for="ptype1">拾</label>
<input type="radio" value="2" name="ptype" id="ptype2" /><label for="ptype2">个</label>
</span>
&nbsp;&nbsp;&nbsp;
<span class="td6" id="pnumGroup">
定位数：
<input type="radio" value="0" name="pnum" id="pnum0" checked="checked" /><label for="pnum0">0</label>
<input type="radio" value="1" name="pnum" id="pnum1" /><label for="pnum1">1</label>
<input type="radio" value="2" name="pnum" id="pnum2" /><label for="pnum2">2</label>
<input type="radio" value="3" name="pnum" id="pnum3" /><label for="pnum3">3</label>
<input type="radio" value="4" name="pnum" id="pnum4" /><label for="pnum4">4</label>
<input type="radio" value="5" name="pnum" id="pnum5" /><label for="pnum5">5</label>
<input type="radio" value="6" name="pnum" id="pnum6" /><label for="pnum6">6</label>
<input type="radio" value="7" name="pnum" id="pnum7" /><label for="pnum7">7</label>
<input type="radio" value="8" name="pnum" id="pnum8" /><label for="pnum8">8</label>
<input type="radio" value="9" name="pnum" id="pnum9" /><label for="pnum9">9</label>
</span>
<div id="rdoQuickPair"></div>
<br />
<span id="slcNumBtnGroup"> 
<input type="button" value="0" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="1" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="2" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="3" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="4" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="5" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="6" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="7" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="8" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="9" class="colorBtn01 clrBrd_{gametype}" />
</span>
<span>
<input type="button" value="对对" id="slcPair2Num" class="colorBtn01 clrBrd_{gametype}" />
<input type="button" value="豹子" id="slcPair3Num" class="colorBtn01 clrBrd_{gametype}" />
</span>
<br />
金额
<input type="text" value="" id="setMomney" size="3" />
<input type="button" id="btnSetMyNum" value="转送" />

<input type="submit" value="确定" />
<input type="reset" value="取消" />


<br />
<table class="tblMy3D" width="700">
<caption class="title0 bgImg_{gametype}" style="font-size:16px;">三字定位</caption>
<thead>
<tr class="td15">
<th>号码</th>
<th>赔率</th>
<th>选择</th>
<th>号码</th>
<th>赔率</th>
<th>选择</th>
<th>号码</th>
<th>赔率</th>
<th>选择</th>
<th>号码</th>
<th>赔率</th>
<th>选择</th>
<th>号码</th>
<th>赔率</th>
<th>选择</th>
</tr>
</thead>
<tbody id="tbdr21">

</tbody>  
</table>




</form>

</div>   